Friday, September 02, 2005

Jyve Says About SKYPE API


The winner of the competition was Jyve, a Palo Alto, California-based company that decided a year and a half ago to create interactive web sites that could send voice mails, handle call forwarding, and automatically launch instant-messaging sessions.

The company added these features, even knowing that Skype was planning to add call forwarding and other similar features on its own.

“It was a way to get a little more buzz and attention,” said Andrew Hansen, vice president of business development and channel sales at Jyve. “We found very quickly that once we showcased our talent in integrating Skype into software, we became quite popular.”

In the two months since Jyve has released its application, it has heard from many potential hardware and software partners who want the company to build customer applications around its web tools.

For example, Jyve worked closely with Multi-Link, a telephony hardware company that wanted to produce a Skype adapter, on defining its Skype strategy.

“It’s very lucrative business-wise,” said Mr. Hansen. “We are positioned to take advantage of this new economy from Skype.”

He doesn’t feel threatened by Skype’s recent move to open its API more widely to developers.

“It will also open up a lot more opportunities,” said Jyve CEO Charles Carleton. “We’re fairly well positioned and far enough ahead of the curve so we may capitalize on the opportunities more than people who are new to the APIs.”

“It’s a big enough sandbox for everyone to play in,” agreed Mr. Hansen. “It’s like Microsoft, but on a smaller scale.”

Skype too is facing increased competition in the free VoIP market with Google’s entry into the market last week with Google Talk (see Google Learns to Talk). But Skype executives also claim they don’t mind the extra competition.

“It does change the dynamics of the VoIP space and the communications landscape, but we welcome the competition,” said Mr. Pryor.

He pointed out, however, that Google has not yet released any tools for developers to tie into its VoIP utility.

“They have yet to integrate very easily with hardware and software,” said Mr. Pryor. “Google hasn’t produced an API yet to make it extensible or to integrate with hardware and software. We have a competitive advantage there since we’re reaching out to developers from the beginning, but I’m sure Google won’t be far behind.”

Skype Vs Google in VoIP

Kazaa Vets

Skype was created by Niklas Zennström and Janus Friis, the founders of Kazaa, a peer-to-peer audio exchange program, two years ago. It has rapidly moved beyond the computer-to-computer space with services such as Skype Out, which allows users to call traditional phone numbers anywhere.

The Google application is, on the other hand, still very limited, pointed out Scott Kessler, an Internet analyst with Standard & Poor’s. And it’s only available to Gmail users at this point.

“It’s uncertain if you’re going to see broad adoption,” said Mr. Kessler. “Google Talk is exceedingly limited, from having to have a Gmail account, to having to have a computer, and having someone you’re in touch with on the same network.”

Then again, Google Talk is free, at least for now. And Mr. Kessler noted that if users asked for a capability to make calls to land-line phones, Google would probably try to provide it. In other words, down the road, Google Talk could eventually become a Skype-killer.

“They’ll compete with each other, and Google might have an advantage, because their business model is not based on this offering,” said In-Stat analyst Keith Nissen. “Skype is ultimately going to have to wonder, ‘Where are we going to get money from?’”

Google derives the bulk of its revenue from online advertising. In its most recent quarter, it posted net income of $342.8 million, or $1.19 per share, on revenue of $890 million.

Analysts have often said that it needs to diversify its business model. The Mountain View, California-based company has said it isn’t going to run any ads on Google Talk.

Friday, July 08, 2005

Javascript Cookies

// JavaScript Document
/**
* Sets a Cookie with the given name and value.
*
* name Name of the cookie
* value Value of the cookie
* [expires] Expiration date of the cookie (default: end of current session)
* [path] Path where the cookie is valid (default: path of calling document)
* [domain] Domain where the cookie is valid
* (default: domain of calling document)
* [secure] Boolean value indicating if the cookie transmission requires a
* secure transmission
*/
function setCookie(name, value, path, domain, secure)
{
var today = new Date();
var expires = new Date(today.getTime() + 150 * 24 * 60 * 60 * 1000);
document.cookie= name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}

/**
* Gets the value of the specified cookie.
*
* name Name of the desired cookie.
*
* Returns a string containing value of specified cookie,
* or null if cookie does not exist.
*/
function getCookie(name)
{
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1)
{
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else
{
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1)
{
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}

/**
* Deletes the specified cookie.
*
* name name of the cookie
* [path] path of the cookie (must be same as path used to create cookie)
* [domain] domain of the cookie (must be same as domain used to create cookie)
*/
function deleteCookie(name, path, domain)
{
if (getCookie(name))
{
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}

// CALLING

<a href="#" onclick='setCookie("test", "1")'>Set
Cookie!</a>

<a href="#" onclick='alert(getCookie("test"))'>Get
Cookie!</a>

Tuesday, May 17, 2005

Example for Mod RewriteRule

#--MOD Rewirite--
RewriteEngine On
RewriteRule ^dir/(.*) /home/httpd/vhosts/jyvepresence.com/httpdocs/index.php?status=$1

#-----------------------
# URL will be
# http://www.domain.com/dir/vikrant
# It will execute index.php
# $1 == vikrant
#------------------------

RewriteRule ^/?([^/]*\.png|[^\./]*)[:;,\.]*$ /home/httpd/vhosts/jyvepresence.com/httpdocs/index.php?status=$1 [L,NS]

#-----------------------
# URL will be
# http://www.domain.com/vikrant.png OR http://www.domain.com/vikrant
# It will execute index.php
# $1 == vikrant.png OR $1 == vikrant
#------------------------

2 -------------------------------------
Old dynamic url:
Code:
www.domain.com/catalog.php?cat=widgets&product_id=1234
New static url:
Code:
www.domain.com/catalog/widgets-1234.html
Code:
#start .htaccess code
RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} ^cat\=([^&]+)\&product_id\=([^&]+)$
RewriteRule ^$ /catalog/%1-%2.html [R=301,L]


Reg Expression notes:
[^&]+ mean find any character except the "&" since it is what seperates the variables in a string. you can back reference matches in a rewrite condition using ()'s just like your rewrite rules but to call them you have to use a % instead of a $.

Benefits:
1. You don't have to hand write 1,000's of 301 redirects

2. Spiders can easily pick up the 301 and pass the scores and index the new urls much faster than having to crawl the entire site over from scratch.

3. Users clicking old dynamic urls in the SERPS will not get a 404 error. They'll go straight to the new static urls.

3 -----------------------------

Browser Dependent Content


Description:

At least for important top-level pages it is sometimes necessary to provide the optimum of browser dependent content, i.e. one has to provide a maximum version for the latest Netscape variants, a minimum version for the Lynx browsers and a average feature version for all others.
Solution:

We cannot use content negotiation because the browsers do not provide their type in that form. Instead we have to act on the HTTP header "User-Agent". The following condig does the following: If the HTTP header "User-Agent" begins with "Mozilla/3", the page foo.html is rewritten to foo.NS.html and and the rewriting stops. If the browser is "Lynx" or "Mozilla" of version 1 or 2 the URL becomes foo.20.html. All other browsers receive page foo.32.html. This is done by the following ruleset:

RewriteCond %{HTTP_USER_AGENT} ^Mozilla/3.*
RewriteRule ^foo\.html$ foo.NS.html [L]

RewriteCond %{HTTP_USER_AGENT} ^Lynx/.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[12].*
RewriteRule ^foo\.html$ foo.20.html [L]

RewriteRule ^foo\.html$ foo.32.html [L]

4-----------------------------------------------------

Simple Example

Just to help illustrate how you could use this information let's assume we had 3 web pages:

http://www.desilva.biz/wd_010427.php
http://www.desilva.biz/grafix_index.php
http://www.desilva.biz/hw_010506.php

and we want to re-direct our readers visiting each page above to their new versions at:

http://www.desilva.biz/refresh.html
http://www.desilva.biz/grafix.html
http://www.desilva.biz/cpuspeed.html

.htaccess

RewriteEngine on
RewriteRule ^wd_010427\.php$ refresh.html [R=301,L]
RewriteRule ^grafix_index\.php$ grafix.html [R=301,L]
RewriteRule ^hw_010506\.php$ cpuspeed.html [R=301,L]



Wednesday, March 30, 2005

Fantastic JavaScripts

Java Script Regular Expressions ..... (find the match and replace it)

Replace ASP tags with blank <% anything %>

<script language=JavaScript>

var theString

theString = "<html> vikrant </html> <% cieling 'done 'dfsfd
%> <div>rahesh </div> <% goahed %> <b>vik </b>";

theString = theString.replace(/<%.*?%>/gi,' ');

alert (theString);


</script>



HELP URL : http://www.sitepoint.com/print/expressions-javascript

Monday, March 28, 2005

Jyve-Skype in NY Times

Hi friends I am very happy today for the work Iam doing from last 10 months is noticable to the and getting Popular among the web-world and the Tehnology.

This a news Article in NY times about the Jyve.com

Even without government intervention, however, random Skyping appears likely to continue in some form. The next phase may be more formalized Skype-enabled social networks like www.jyve.com, which connects people with similar interests and desire to practice a certain language, and www.someonenew.com, which connects people for romantic purposes. Only a few English-language social networking sites currently use Skype, but such sites in Asia have been very successful.

Jyve, according to Charles Carleton, a co-founder, will be introducing a feature in the next few months that Mr. Carleton hopes will protect the medium's social capabilities: an eBay-like feedback system to help users reject callers with a track record of inappropriate conversation. Skype is happy to leave these functions to other companies. "We're probably never going to run a dating service or language seminars," Ms. Larabee said of Skype. "Our business is the technology, not the networks."

Vikrant.

Friday, February 18, 2005

MySQL Functions (Usefull in Programming)

I am running on MySql 3.23.58 version

1 . Concat the String
SELECT CONCAT('My', 'S', 'QL');
-> MySQL
-----------

2. Concat with Word Separator
SELECT (CONCAT_WS(",","First name","Second name","Last Name")) as fullname;
-> First name,Second name,Last Name
-----------

3. String Length
SELECT LENGTH('text');
->4
-----------

3. String Padding (Add characters to string)
String must contin 4 character long if 1st_expr is not contain 4
charater then add 3rd_expr to String.
SELECT LPAD('hi',4,'..');
-> '..hi'
SELECT RPAD('hi',4,'..');
-> 'hi'
-----------

4. String Padding (Add character to string)
SELECT LEFT('foobarbar', 5);
->'fooba'
SELECT RIGHT('foobarbar', 5);
->'arbar'

COMBINATION OF 3 & 4 Point
SELECT RPAD(LEFT('foobarbar', 5),8,'.') as str;
-> fooba...


## Miscellaneous Functions

SELECT DATABASE();
-> current Working databse

SELECT USER();
-> curent User

SELECT SUBSTRING_INDEX(USER(),"@",1);
-> Concat userstring

SELECT VERSION();
->Current Mysql version

SELECT CONNECTION_ID();
-> Current connectio Id


MySql IFNULL, IF, CASE-WHEN-THEN -ELSE-END

IFNULL(expr,expr1)
--------------------------------------------
If 1st_ expr is null then retrun 2nd_expr

SELECT IFNULL(1,0);
-> 1
SELECT IFNULL(NULL,10);
-> 10
SELECT IFNULL(1/0,10);
-> 10
SELECT IFNULL(1/0,'yes');
-> 'yes'
--------------------------------------------------------------
CASE WHEN condiion THEN expr1 ELSE expr3 END
--------------------------------------------------------------

SELECT (CASE 2 WHEN 1 THEN "one" WHEN 2 THEN "two" ELSE "more" END) as ans;
-> two

SELECT CASE WHEN 1<0 style="color: rgb(255, 0, 0);">THEN "true" ELSE "false" END;
->false
--------------------------------------------------------------
IF(condition,expr,expr1)
--------------------------------------------------------------

SELECT IF(0.1<>0,1,0);
-> 1
SELECT IF(STRCMP('test','test1'),'no','yes');
-> no

Tuesday, February 15, 2005

How to create SubDomains by editing httpd.conf

VirtualHost:
If you want to maintain multiple domains/hostnames on your
machine you can setup VirtualHost containers for them.

Types of Virtual Hosting
1) IP-Based Virtual Hosting
2) Name-Based Virtual Hosting
3) Dynamic Virtual Hosting

Good Example how to set subDomains under NameBased Virtual Hosting :

NOTE: NameVirtualHost cannot be used without a port specifier
(e.g. :80) if mod_ssl is being used, due to the nature of the
SSL protocol.

Change Apache's httpd.conf file

NameVirtualHost 215.51.182.53

<VirtualHost 216.55.183.51>
ServerName *.yourdomain.com
ServerAlias yourdomain.com
DocumentRoot /home/rootdir #Directory where Scritpting files are located.
ErrorLog logs/error_log #Error are recorded in error_log file located /var/logs/httpd
CustomLog logs/visit_log combined # URL visit information recorded in visit_log file located /var/logs/httpd
</VirtualHost>

<VirtualHost 216.55.183.51>
ServerName subdomain.youydomain.com
ServerAlias subdomain.youydomain.com
DocumentRoot /home/rootdir/subdomain
ErrorLog logs/error_log
CustomLog logs/visit_log
</VirtualHost>

<VirtualHost 216.55.183.51>
ServerName subdomain1.youydomain.com
ServerAlias subdomain1.youydomain.com
DocumentRoot /home/rootdir/subdomain
ErrorLog logs/error_log
CustomLog logs/visit_log
</VirtualHost>

NOTE :
You can create n number of SubDoamins on one IP address

Apache's Module (Somthing useful in httpd.conf for Web Programmer)

If you want to include any New settings whithout editing
httpd.conf file then copy following line once into your server
httpd.conf file. And later if you want to add new Module then edit subdomain.conf
and restart the server.
#------------------------------------------
Include /home/jyve_conf/subdomain.conf
#------------------------------------------


DirectoryIndex: sets the file that Apache will serve if a directory
is requested. If you requested http://yourdomain.com then server will automatically search index.html first for default file if not found then search for any mathch in the follwing list. You can list any file which you want to serve as default when user request for directory
#-------------------------------------------------------
DirectoryIndex index.html index.html.var index.php3
#-------------------------------------------------------


if your .htaccess is file is not working then add following lines in httpd.conf
(red) is folder path where .htaccess file located.
#-------------------------------------------------------------
<Directory /home/vikrant/userprofile>
AllowOverride All
</Directory>
#-------------------------------------------------------------



Important Linux Commands

Tar , UnTar and UnZip
--------------------------------
tar -zxf 18012005.tar vikrant/
tar -zcf newtitle.tar *.php
unzip myzip.zip

Folder SIZE
----------------
du -skh * | less -- Check the folder size
du -skh *| grep M | less -- Check the folder size which has MB

SCP:
-------------
-->Upload File to Server
# scp config.php username@www.youdomain.com:/home/rootdir/filename.php

-->Download file from server on Currnet directory.
# scp username@www.youdomain.com:/home/rootdir/filename.php .

Fetch (Download files from server)
-----------------------------------------
#wget http://yuordomain.com .

List Contents of Directory
---------------------------------
ls -l | wc -- (Get Number of Files /Content)
ls -lah -- (Human redable file size)

Check ServerLoad
----------------------
w

CronTab Quick Reference

What is Cron Tab ?
cron is a unix utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon often termed as cron jobs.
Crontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times.

Restriction
You can execute crontab if your name appears in the file
/usr/lib/cron/cron.allow. If that file does not exist, you can use
crontab if your name does not appear in the file
/usr/lib/cron/cron.deny.
If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab. The allow/deny files consist of one user name per line.

Commands
export EDITOR=vi ;to specify a editor to open crontab file.

crontab -e Edit your crontab file, or create one if it doesn't already exist.
crontab -l Display your crontab file.
crontab -r Remove your crontab file.
crontab -v Display the last time you edited your crontab file. (This option is only available on a few systems.)

Crontab File
A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (1 - 7) (monday = 1)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)

Environment
cron invokes the command from the user's HOME directory with the shell, (/usr/bin/sh).
cron supplies a default environment for every shell, defining:
HOME=user's-home-directory
LOGNAME=user's-login-id
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh

Users who desire to have their .profile executed must explicitly do so
in the crontab entry or in a script called by the entry.

Disable Email
By default cron jobs sends a email to the user account executing the cronjob. If this is not needed put the following command At the end of the cron job line .

>/dev/null 2>&1

Generate Log File
To collect the cron execution execution log in a file :

30 18 * * * rm /home/someuser/tmp/* > /home/someuser/cronlogs/clean_tmp_dir.log

Examples :
Cron set For Database BackUp

5 21 * * * mysqldump -u root -pclarion --opt specto | gzip > /backup1/amodd/spec
to_`date +%Y%m%d%H%M`.gz

Cron Set for run PHP File ..
* 0,6,12,18 * * * /usr/bin/php -q /var/www/html/vikrant/goskype/expertblog/blogsadmin/runcron.php > /dev/null


HTTP Authentication to Folder. (.htaccess /.htpasswd)

Write Following code in .htaccess file and save it into the folder which you want to
authonticate.

Change the path (In red) and enter the Folder path which you want to authenticate.

------------------------------------------------------------------

AuthUserFile /mnt/web/guide/somewhere/somepath/.htpasswd
AuthGroupFile /dev/null
AuthName "Somewhere.com's Secret Section"
AuthType Basic
<Limit GET POST>
require valid-user
</Limit>

--------------------------------------------------------------------
To create an .htpasswd file, login to the server via telnet(Command line) go to the directory you specified in AuthUserFile. In the example, this is /mnt/web/guide/somewhere/somepath. Then use the htpasswd program with the -c switch to create your .htpasswd in the current directory. (as per following)

----------------------------------------
htpasswd -c .htpasswd username
Adding password for username.
New password:
password
Re-type new password:
password
---------------------------------------

To delete users, open the .htpasswd file in a text editor and delete the appropriate lines:



Execute PHP syntax in .HTML file

If you want to run PHP code in .html extention file
Then Follow following procedures.

1. Write Following code in the .htaccess file
---------------------------------------------
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
-----------------------------------------------------

2. Upload it to your server (to your WWW root) where your
.html files are located in which contains PHP code.

Thats the idea.